home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / tjgold.zip / INSTALL.004 / FGUSER08.TXT < prev    next >
Text File  |  1995-05-29  |  4KB  |  138 lines

  1.                                  Calculators
  2.  
  3.                       "Authors, like coins, grow dear as they grow old;
  4.                                    it's the rust we value not the gold"
  5.                                   Alexander Pope "Imitations of Horace"
  6.  
  7. Introduction
  8.  
  9.           The GOLDCALC unit is designed to do one thing; display a
  10.      pop-up calculator in a window. The calculator has the following
  11.      features:
  12.  
  13.           Calculator can be displayed in a tall (shown in Figure 8.1),
  14.           wide or user-defined custom format.
  15.  
  16.           Optional display of a calculator tape.
  17.  
  18.           Fully customizable colors.
  19.  
  20.  
  21.      Figure 8.1
  22.      A Calculator
  23.  
  24.  
  25. Running the Calculator
  26.  
  27.      To display a (modal) calculator in a pop-up window use the
  28.      RunCalculator command which is defined as follows:
  29.  
  30.      RunCalculator(Tit:string): extended;
  31.  
  32.           Displays a calculator in a pop-up window. The only parameter
  33.      is the window title. The function returns the value in the entry
  34.      panel when the window was closed.
  35.  
  36.           You can control whether the calculator has a tape by setting
  37.      the value of the boolean variable CalcVars.Tape. Set the variable
  38.      to TRUE to display the tape, and FALSE to hide it.
  39.  
  40.      Run the demo file DEMCALC1.PAS to use the default calculator.
  41.  
  42. Changing the Calculator Shape
  43.  
  44.           By default, the calculator is configured in a tall orientation
  45.      with the buttons at the bottom, the tape at the top and the input
  46.      panel in between.
  47.  
  48.           The calculator shape is controlled by the value of the
  49.      gCalcType variable  CalcVars.Style. The gCalcType enumerated type
  50.      is defined in GOLDCALC as follows:
  51.  
  52.      gCalcType = ( CalcCustom, CalcWide, CalcTall );
  53.  
  54. Displaying a Wide Calculator
  55.  
  56.           To display a wide calculator, set the value of CalcVars.Style
  57.      to CalcWide before calling RunCalculator. That's all there is to
  58.      it. Listed below is an extract from the demo file DEMCALC2.PAS
  59.      which displays a wide calculator.
  60.  
  61.         CalcVars.Style := CalcWide;
  62.         MouseShow(true);
  63.         Answer := RunCalculator(' A Wide Calculator ');
  64.  
  65. Displaying a Custom Calculator
  66.  
  67.           If, for some inexplicable reason, you don't like the tall or
  68.      the wide calculator, you can set the calculator to a custom shape
  69.      by modifying the following variables in CalcVars:
  70.  
  71.      CalcVars Variable   Purpose
  72.  
  73.      WX1,WY1,WX2,WY2     The upper left and lower right (global) window
  74.                          coordinates.
  75.      BX1, BY1            The upper left (local) coordinates of the
  76.                          button cluster.
  77.      IX1, IY1            The upper left (local) coordinates of the input
  78.                          panel.
  79.      PanelWidth          The width of the input panel in characters.
  80.  
  81.           The following code is an extract from the demo file
  82.      DEMCALC3.PAS which sets the calculator to a compact shape with no
  83.      tape:
  84.  
  85.      with CalcVars do
  86.      begin
  87.         Style := CalcCustom;
  88.         WX1 := 26;
  89.         WY1 := 5;
  90.         WX2 := 53;
  91.         WY2 := 17;
  92.         BX1 := 2;
  93.         BY1 := 4;
  94.         IX1 := 2;
  95.         IY1 := 2;
  96.         Tape := false;
  97.         PanelWidth := 23;
  98.      end;
  99.      Answer := RunCalculator('');
  100.  
  101.  
  102. Controlling the Calculator Colors
  103.  
  104.           You can customize the calendar display colors by modifying the
  105.      following elements of TINT using the GoldSetColor function:
  106.  
  107.      CalcBorder
  108.      CalcBody
  109.      CalcTitle
  110.      CalcIcons
  111.      CalcOperand
  112.      CalcTape
  113.      CalButtons
  114.  
  115.           The following code is an extract from DEMCALC4.PAS which
  116.      customizes the calendar colors:
  117.  
  118.      procedure CustomizeColors;
  119.      begin
  120.         GoldSetColor(CalcBorder,WhiteOnMagenta);
  121.         GoldSetColor(CalcBody,WhiteOnMagenta);
  122.         GoldSetColor(CalcIcons,GreenOnMagenta);
  123.         GoldSetColor(CalcTitle,YellowOnMagenta);
  124.         GoldSetColor(CalcInput,BlackOnLightgray);
  125.         GoldSetColor(CalcOperand,LightgrayOnMagenta);
  126.         GoldSetColor(CalcTape,GreenOnMagenta);
  127.         GoldSetColor(CalcButtons,WhiteOnGreen);
  128.      end; { CustomizeColors }
  129.  
  130.  
  131. Error Handling
  132.  
  133.           Since the calculator is displayed in a window, there is the
  134.      potential for an Out of Memory error. After calling RunCalculator,
  135.      be sure to call the function LastCalcError to see if the calculator
  136.      was successfully displayed.
  137.  
  138.